package my;

import net.egork.io.InputReader;
import java.io.PrintWriter;

public class TaskA {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
        int left = 0, right = 0;
        int n = in.readInt();
        for (int i = 0; i < n; ++i) {
            left += in.readInt();
            right += in.readInt();
        }
        int ans = Math.min(left, n - left) + Math.min(right, n - right);
        out.println(ans);
	}
}
